<?php
//1.设置响应数据格式json
header("Content-Type:application/json;charset=utf-8");
//2.引入init.php
require("../init.php");
//3.sql语句
$sql = " SELECT * FROM dk_book_family ";
$result = mysqli_query($conn, $sql);
if(mysqli_error($conn)){
    echo mysqli_query($conn);
}
echo json_encode(mysqli_fetch_all($result, MYSQLI_ASSOC));
?>